package com.hq.controller;
import com.github.pagehelper.PageInfo;
import com.hq.pojo.Appointment;
import com.hq.pojo.Doctor;
import com.hq.service.MassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date;
import java.util.List;
import java.util.Map;


@Controller
@RequestMapping("/appointment")
public class MassController {
    @Autowired
    private MassService massService;

    //    查询群众信息
    @RequestMapping("/selectAllMass")
    @ResponseBody
    public PageInfo<Appointment> selectAllMass(String username){
        return massService.selectAllMass(username);
    }

    //   预约体检
    @RequestMapping("/addAppointment")
    @ResponseBody
    public Map<String,String> addAppointment(Appointment appointment){
        return massService.addAppointment(appointment);
    }

    //    取消体检
    @RequestMapping("/deleteAppointment")
    @ResponseBody
    public Map<String,String> deleteAppointment(int appointId){
        return massService.deleteAppointment(appointId);
    }



    //修改预约信息
    @RequestMapping("/appointmentEdit")
    @ResponseBody
    public Map<String,String> appointmentEdit(Appointment appointment){

        return massService.appointmentEdit(appointment);
    }
}